home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Programming / RJTextEd.exe / {userappdata} / RJ TextEd / Scripts / examples / PreviousMethod.pas < prev   
Encoding:
Pascal/Delphi Source File  |  2008-10-03  |  633 b   |  24 lines

  1. // A simple pascal script to navigate to the previous 
  2. // method in your source code.
  3. // You can assign a keyboard shortcut to this script.
  4. // E.g. Ctrl+Alt+Up
  5.  
  6. procedure GotoPreviousMethod;
  7. begin
  8.    if not Document.GotoPreviousMethod(False,True) then
  9.    begin
  10.       if MessageDlg('Could not find a method! Do you want to start again from the bottom?',mtInformation,mbYes or mbNo,0) = mrYes then
  11.       begin
  12.          Document.CursorDocEnd(False);
  13.          Document.CursorX := 0;
  14.          Document.GotoPreviousMethod(False,True);
  15.       end; 
  16.    end;  
  17. end;
  18.  
  19. // Main function
  20. begin
  21.    GotoPreviousMethod; 
  22. end.
  23.  
  24.